package 字节流;

import java.io.*;

public class 无返回值拷贝 extends Throwable {
    public static void 无返回值拷贝(File srcFile,File destFile) throws Exception {
        //创建读写
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream(srcFile));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(destFile));
        //拷贝
        byte[] data=new byte[1024];
        int len;

        while ((len=bis.read(data))!=-1){
            bos.write(data,0,len);
        }
        bis.close();
        bos.close();
    }
}
